package com.common.frame.bean

/**
 *
 * create by sunxy on 2021/2/6
 **/
data class PageModel(var pageIndex: Int = FIRST_PAGE_INDEX, var pageSize: Int = 20) {

    companion object{
        const val FIRST_PAGE_INDEX = 0
    }

    fun isFirstPage() = pageIndex == FIRST_PAGE_INDEX

    fun onRefresh() {
        pageIndex = FIRST_PAGE_INDEX
    }

    fun nextPageIndex() = ++pageIndex

    fun getSkipCount() = pageIndex * pageSize

}